//package com.palm.hubo2o.ui;
//
//import android.os.Bundle;
//import android.support.design.widget.TabLayout;
//import android.support.v4.app.FragmentManager;
//import android.view.MenuItem;
//
//import com.palm.hubo2o.BaseActivity;
//import com.palm.hubo2o.R;
//import com.palm.hubo2o.util.Constant;
//
//import butterknife.Bind;
//
///**
// * Created by dest1 on 2015/11/3.
// */
//public class SSQTrendActivity extends BaseActivity implements TabLayout.OnTabSelectedListener {
//    @Bind(R.id.tab_trend_ssq)
//    TabLayout mTabLayout;
//    private FragmentManager manager;
//    private TrendFragment redFragment;
//    private TrendFragment blueFragment;
//
//    @Override
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_trend_ssq);
//        changeWindowColor(getColorRGB(R.color.headerTextColor));
//        manager = getSupportFragmentManager();
//        mTabLayout.addTab(mTabLayout.newTab().setText("红球走势"), true);
//        mTabLayout.addTab(mTabLayout.newTab().setText("蓝球走势"));
//        mTabLayout.setOnTabSelectedListener(this);
//        onTabSelected(mTabLayout.getTabAt(0));
//    }
//
//    @Override
//    public void onTabSelected(TabLayout.Tab tab) {
//        switch (tab.getPosition()) {
//            case 0:
//                if (redFragment == null) {
//                    redFragment = new TrendFragment();
//                    redFragment.setMarkColor(getColorRGB(R.color.red));
//                    redFragment.setTrendInfo(Constant.LOTTERY_SSQ, "RED_OMIT");
//                    manager.beginTransaction().add(R.id.container_trend_ssq, redFragment, "red").commit();
//                } else
//                    manager.beginTransaction().hide(manager.findFragmentByTag("blue")).show(redFragment).commit();
//                break;
//            case 1:
//                if (blueFragment == null) {
//                    blueFragment = new TrendFragment();
//                    blueFragment.ifNeedLink(true);
//                    blueFragment.setMarkColor(getColorRGB(R.color.blue));
//                    blueFragment.setTrendInfo(Constant.LOTTERY_SSQ, "BLUE_OMIT");
//                    manager.beginTransaction().hide(redFragment).add(R.id.container_trend_ssq, blueFragment, "blue").commit();
//                } else
//                    manager.beginTransaction().hide(manager.findFragmentByTag("red")).show(blueFragment).commit();
//                break;
//            default:
//                break;
//        }
//    }
//
//    @Override
//    public void onTabUnselected(TabLayout.Tab tab) {
//
//    }
//
//    @Override
//    public void onTabReselected(TabLayout.Tab tab) {
//
//    }
//
//    @Override
//    public boolean onOptionsItemSelected(MenuItem item) {
//        if (item.getItemId() == android.R.id.home) {
//            finish();
//            return true;
//        }
//        return super.onOptionsItemSelected(item);
//    }
//}
